package Test;

import javax.swing.*;

public class JDialogTest {
    public static void Test01() {

        JFrame frame = new JFrame("JFrame窗体");
        frame.setVisible(true);
        frame.setSize(500,500);
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

        JDialog jDialog = new JDialog(frame,"对话框",true);
        jDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        jDialog.setSize(250,250);
        jDialog.setLocation(100,100);
        jDialog.setVisible(true);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(JDialogTest::Test01);
    }
}
